package cn.yufu.swagger.controller;

import io.swagger.annotations.ApiOperation;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.yufu.swagger.domain.User;

@RestController
public class FirstBootController {

	@ApiOperation("根据ID获取用户信息")
	@RequestMapping(value = "/getUserInfo", method = RequestMethod.GET)
	public User getUserInfo(@RequestParam("id") int id) {
		if (1 == id) {
			return new User(1, "小红", "123456");
		}
		return new User(2, "小刚", "234567");
	}
}
